﻿/*
    File name:          AbstarctDatabase
    File type:          Interface
    Author:             Jakob Sulby 09136
    Creation date:      24-03-2011
    Last modified:      30-03-2011
    Last modified by:   Bjarke Runz 09676
    Description:        AbstractDatabase is an interface which enable the project to switch to another type of database.
*/

using System;
using System.Collections.Generic;

namespace i4pro_gruppe_d.Database
{
    using Types;
    public abstract class AbstractDatabase
    {
        private static AbstractDatabase instance;

        protected AbstractDatabase()
		{
		}
        public static AbstractDatabase Instance
		{
			get { return instance ?? (instance = new MSSQL()); }
            set { instance = value; }
		}

        public abstract bool  WriteBrick(Brick brick);
        public abstract List<Brick> ReadBrick(DateTime date);
        public abstract bool UpdateBrick(Brick brick);

        //Programmer tab
        public abstract Script ReadScript(string scriptName);
        public abstract List<String> ReadScriptNames();
        public abstract bool WriteScript(Script script);
        public abstract bool RemoveScript(string script);


        //Kald når et program skal startes
        public abstract bool NewBatch(DateTime startTime, DateTime finishTime);
       
        //Kald når et program skal gemmes
        public abstract bool SetBatchEndTime(DateTime finishTime);

        //Robot
        public abstract bool WriteRobot(Robot robot);

        //Eventlog
        public abstract bool WriteEventLog(EventLog eventLog);
        public abstract List<Log> ReadLog(DateTime dateTime);

        //User
        public abstract bool UpdateUser(User user, String oldUserName);
        public abstract bool NewUser(User user);
        public abstract int GetUserRights(User user);
        public abstract List<User> getUserList();
        public abstract bool DeleteUser(User user);
    }
}
